package cn.com.scitc.licenseplateback.dao;

import cn.com.scitc.licenseplateback.model.CityCodeEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface CityCodeDao extends JpaRepository<CityCodeEntity, Integer> {

    /**
     * 根据用户定位的城市，获取城市编号
     * @param city
     * @return 城市编号
     */
    @Query(value = "select c from CityCodeEntity c where c.city like %:city%")
    CityCodeEntity findByCitycode(String city);
}
